﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Devonline.Identity;

/// <summary>
/// 级别, 字符串类型的默认实现
/// </summary>
[Table("level"), DisplayName("级别")]
public class Level : Level<string>, IIdentity, IEntitySet, IEntitySetWithCreate, IEntitySetWithCreateAndUpdate { }

/// <summary>
/// 级别
/// </summary>
[Table("level"), DisplayName("级别")]
public class Level<TKey> : Identity<TKey>, IIdentity<TKey>, IEntitySet<TKey>, IEntitySetWithCreate<TKey>, IEntitySetWithCreateAndUpdate<TKey> where TKey : IConvertible
{
    /// <summary>
    /// 名称
    /// </summary>
    [Column("name"), Required, Unique, MaxLength(256), DisplayName("名称")]
    public override string Name { get; set; }
    /// <summary>
    /// 级别的值
    /// </summary>
    [Column("value"), DisplayName("级别"), Excel]
    public virtual int Value { get; set; }
}